import '../common/lib';
import App from '../component/App';
import React from 'react';
import {render} from 'react-dom';
import {Router, hashHistory } from 'react-router';
import injectTapEventPlugin from 'react-tap-event-plugin';


const rootRoute = {
  childRoutes: [{
    path: '/',
    component: App,
    indexRoute: { onEnter: (nextState, replace) => replace('/hello') },
    childRoutes: [
      require('../route/Hello'),
      require('../route/World')
    ]
  }]
};
// Needed for onTouchTap
// http://stackoverflow.com/a/34015469/988941
injectTapEventPlugin();

// Render the main app react component into the app div.
// For more details see: https://facebook.github.io/react/docs/top-level-api.html#react.render
// render(<App />, document.getElementById('app'));
render(
  <Router history={hashHistory} routes={rootRoute} />,
  document.getElementById('app'));
